package com.adingxiong.cft.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName KafkaInitialConfig
 * @Description  初始化并自动创建 topic并设定分区和副本
 * @Author xiongchao
 * @Date 2021/3/24 13:22
 **/
//@Configuration
public class KafkaInitialConfig {

    @Bean
    public NewTopic initTopic() {
        return new NewTopic("auto-topic",4,(short) 1);
    }

    @Bean
    public NewTopic updateTopic() {
        return new NewTopic("auto-topic",6 ,(short)1);
    }

}
